package com.icehand.axon.demo.command.commands;

import com.icehand.axon.demo.common.domain.AccountId;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.axonframework.commandhandling.TargetAggregateIdentifier;

import java.math.BigDecimal;

/**
 * @author icehand
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class WithdrawMoneyCommand {
    @TargetAggregateIdentifier
    private AccountId accountId;
    private BigDecimal amount;

    public WithdrawMoneyCommand(String id, BigDecimal amount) {
        this.accountId = new AccountId(id);
        this.amount = amount;
    }
}
